﻿using UnityEngine;
using System.Collections;

public class combat : MonoBehaviour
{
	
	public int whatplayer;
	
	
	// Use this for initialization
	void Start ()
	{
	
	}
	
	// Update is called once per frame
	void Update ()
	{

	
	}
	
	void OnTriggerStay (Collider other)
	{
		
		
		if (whatplayer == 1 && 
			Input.GetKeyDown (KeyCode.LeftShift) &&
			other.gameObject.name == "Enemy") {
			other.gameObject.GetComponent<Enemy> ().life -= 1;
			
		}
		if (whatplayer == 2 && 
			Input.GetKey (KeyCode.RightShift) &&
			other.gameObject.name == "Enemy") {	
			other.gameObject.GetComponent<Enemy> ().Scream ();
		}
	}
}
			
